package wodegua.d31_java高级.d1_junit;


import org.junit.*;
import org.junit.Test;

public class StringUtilTest {
    @BeforeClass
    public static void testClass1(){
        System.out.println("BeforeClass testClass1 执行");
    }
    @AfterClass
    public static void testClass2(){
        System.out.println("AfterClass testClass2 执行");
    }
    @Before
    public void test1(){
        System.out.println("Before test1 执行");
    }
    @After
    public void test2(){
        System.out.println("After test2 执行");
    }
    @Test
    public void testGetLength(){
        System.out.println(StringUtil.getLength(null));
        System.out.println(StringUtil.getLength("admin"));
    }

    @Test
    public void testGetMaxIndex(){
        System.out.println(StringUtil.getMaxIndex(null));
        Integer max = StringUtil.getMaxIndex("admin");
        System.out.println(max);

        Assert.assertEquals("admin的最大索引应是4",Integer.valueOf(4), max);
    }
}
